< previous page page_156 next page >

Page 156
This last routine is unique in that it is the only routine that requires parameters to be passed. Because ConditionalValidate is checking the status of more than one control, you need to supply it with the name and contents of the dependent control.
Finally, update the Text1_LostFocus event to match the one shown in Listing 5.46.
Type.gifListing 5.46. Updated Text1_LostFocus event.
Private Sub Text1_LostFocus()
    '
    If CheckRange = True Then InRangeValidate
    If CheckSize = True Then CheckSizeValidate
    If Required = True Then CheckRequired
    '
End Sub
That's the end of the coding for the VText control. Save this control for now while you test one more time.
Testing the Required and Conditional Options of the VText Control
Bring up the TEST.FRM form and add two more VText controls to the form. Set the Name property of one to vtxRequired and of the other to vtxConditional. Add two labels with their captions set to vtxRequired and vtxConditional. For the vtxRequired control, set the CheckRequired property to true. For the vtxConditional control, set CheckConditional to true. Refer to Figure 5.18 for layout details.
0156-01.jpg
Figure 5.18.
Laying out the Required and
Conditional options form.

 
< previous page page_156 next page >

If you like this book, buy it!